package com.neusoft.neuiotms.dcvm.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.neusoft.bizcore.web.dto.result.ResultListDTO;
import com.neusoft.neuiotms.dcvm.bean.StandardCiBean.SchemaDef;
import com.neusoft.neuiotms.dcvm.service.AssetService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api("模型管理")
@RestController
@RequestMapping(value = "/api/w/schemas")
public class SchemaController {

    @Autowired
    private AssetService assetService;

    @ApiOperation("获取分类下所有模型")
    @GetMapping("/category/{code}")
    public ResultListDTO<?> allAssets(@PathVariable final String code) {
        final List<SchemaDef> res = this.assetService.getAllSchemasByCatetories(code);
        return ResultListDTO.success(res);
    }

}
